home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp2.lzh / NT_DSP2.MSA / BENCH / 5-96 < prev    next >
Encoding:
Text File  |  1988-07-19  |  4.3 KB  |  98 lines

  1.     page 132,66,0,6
  2.         opt     rc
  3. ;*******************************************
  4. ;Motorola Austin DSP Operation  June 30,1988
  5. ;*******************************************
  6. ;DSP96001/2
  7. ;8 pole 5 multiply cascaded canonic IIR filter
  8. ;File name: 5-96.asm
  9. ;**************************************************************************
  10. ;    Maximum sample rate: 435.5 KHz at 27.0 MHz
  11. ;    Memory Size: Prog: 4+13 words ; Data :4*(2+5) words
  12. ;    Number of clock cycles:    62 (31 instruction cycles)
  13. ;    Clock Frequency:        27.0 MHz
  14. ;    Cycle time:        74.1 ns
  15. ;**************************************************************************
  16. ;    This IIR filter reads the input sample
  17. ;    from the memory location Y:input
  18. ;    and writes the filtered output sample
  19. ;    to the memory location Y:output
  20. ;
  21. ;    The samples are stored in the X memory
  22. ;    The coefficients are stored in the Y memory
  23. ;**************************************************************************
  24. ;
  25. ;    initialization
  26. ;**********************
  27. ;    The equations of the filer are:
  28. ;       w(n) =    x(n) - ai1*w(n-1) - ai2*w(n-2)
  29. ;       y(n) = b0*w(n) + bi1*w(n-1) + bi2*w(n-2)
  30. ;
  31. ;                     w(n)
  32. ;   x (n)------(-)---------->-|->---bi0---(+)-------> y(n)
  33. ;               A             |            A
  34. ;               |            1/z           |
  35. ;               |             | w(n-1)     |
  36. ;               |             v            |
  37. ;               |-<--ai1----<-|->---bi1-->-|
  38. ;               |             |            |
  39. ;               |            1/z           |
  40. ;               |             | w(n-2)     |
  41. ;               |             v            |
  42. ;               |-<--ai2----<--->---bi2-->-|
  43. ;
  44. ;
  45. ;       X Memory Organization            Y Memory Organization
  46. ;                           |   b0N   | Coef. + 5N-1
  47. ;         |         |                          |   b1N   |
  48. ;         |         |                          |   b2N   |
  49. ;         |         |                          |   a1N   |
  50. ;         |         |                          |   a2N   |
  51. ;         | wN(n-1) | Data + 2N-1              |    .    |
  52. ;         | wN(n-2) |                          |   b01   |
  53. ;         |   .     |                          |   b11   |
  54. ;         |   .     |                          |   b21   |
  55. ;         | w1(n-1) |                          |   a11   |
  56. ;    R0 ->| w1(n-2) | Data                R4 ->|   a21   | Coef.
  57. ;         |         |                          |         |
  58. nsec    equ    4
  59. start    equ    $40
  60. data    equ    0
  61. cddr    equ     0    
  62. input    equ    $ffe0
  63. output    equ    $ffe1
  64. ;
  65. ;                                                       Program  Icycles
  66. ;                                                       Words
  67.  
  68.        move   #data,r0                                  ;     1      1
  69.        move   #coef,r4                                  ;     1      1
  70.        move   #2*nsec-1,m0                              ;     1      1
  71.        move   #4*nsec-1,m4                              ;     1      1
  72. ;                                                            ---    ---
  73.        opt   cc                                         ;     4      4
  74. ;      filter loop:5*nsec+11
  75. ;*************************************************                                   
  76.        movep                      x:input,d0.l          ;     1      2
  77.        float  d0,d0                                     ;     1      1
  78.        fclr   d1                  x:(r0)+,d4.s y:(r4)+,d6.s ; 1      1
  79.        do     #nsec,end_cell                            ;     2      3
  80.        fmpy d4,d6,d1 fadd  d1,d0  x:(r0)-,d5.s y:(r4)+,d6.s ; 1      1
  81.        fmpy d5,d6,d1 fsub  d1,d0  d5.s,x:(r0)+ y:(r4)+,d6.s ; 1      1
  82.        fmpy d4,d6,d1 fsubr d1,d0               y:(r4)+,d6.s ; 1      1
  83.        fmpy d5,d6,d5              d0.s,x:(r0)+ y:(r4)+,d6.s ; 1      1
  84.        fmpy d0,d6,d0 fadd  d5,d1  x:(r0)+,d4.s y:(r4)+,d6.s ; 1      1
  85. end_cell
  86.                      faddr d1,d0                            ; 1      1
  87.        int  d0,d0                                           ; 1      1
  88.        movep                     d0.l,x:output              ; 1      2
  89.                                                             ;---    ---
  90. ;*************************************************         13    5*nsec+11
  91.                                              ;   -----------------------
  92.                                              ;  Totals       15  5*nsec+13
  93.         end
  94.  
  95.  
  96.  
  97.